<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body style="background-color: #ccc;">
<div id="app">
    <div>商品名称：<input v-model="name"/></div>
</div>
</body>
<script src="../../js/vue.js"></script>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            name: '方便面'
        },
        watch: {
            name: {
                handler(newVal, oldVal) {
                    console.log(newVal)
                }
            }
        }
    })
</script>
</html>
